<div>
  <span class="brand" style="font-weight:bold;">{{gatewayApiDialog.title}}</span>
  <div class="card" style="margin-top: 20px;margin-bottom: 10px;">
    <div class="panel-body">
      <form class="form-horizontal" role="form">
        <div class="form-group">
          <label class="col-sm-2 control-label">API 名称</label>
          <div class="col-sm-9">
            <input class="form-control" disabled="" ng-if="gatewayApiDialog.type == 'edit'" ng-model='currentApi.apiName'
                   placeholder="请输入"
                   type="text"/>
            <input class="form-control highlight-border" ng-if="gatewayApiDialog.type == 'add'" ng-model='currentApi.apiName'
                   placeholder="请输入" type="text"/>
          </div>
        </div>

        <div class="form-group" ng-repeat="predicateItem in currentApi.predicateItems track by $index">
          <label class="col-sm-2 control-label">匹配模式</label>
          <div class="col-sm-4 control-label">
            <div align="center" class="form-control highlight-border">
              <input checked ng-model="predicateItem.matchStrategy" title="精确" type="radio" value="0"/>&nbsp;精确&nbsp;&nbsp;
              <input ng-model="predicateItem.matchStrategy" title="前缀" type="radio" value="1"/>&nbsp;前缀&nbsp&nbsp;
              <input ng-model="predicateItem.matchStrategy" title="正则" type="radio" value="2"/>&nbsp;正则&nbsp&nbsp;
            </div>
          </div>
          <label class="col-sm-2 control-label">匹配串</label>
          <div class="col-sm-3 control-label">
            <input class="form-control highlight-border" ng-model="predicateItem.pattern" placeholder="请输入"
                   type='text'/>
          </div>
          <div align="center" class="col-sm-1 control-label">
            <button align="center" class="btn btn-outline-danger"
                    ng-click="removeMatchPattern($index)" ng-if="currentApi.predicateItems.length > 1">X
            </button>
          </div>
        </div>

        <div class="form-group" style="text-align: center">
          <button class="btn btn-outline-primary" ng-click="addNewMatchPattern()">
            <i class="fa fa-plus"></i>&nbsp;新增匹配规则
          </button>
        </div>
      </form>
      <div class="separator"></div>
      <div clss="row" style="margin-top: 20px;">
        <button class="btn btn-outline-danger" ng-click="closeThisDialog()"
                style="float:right; height: 30px;font-size: 12px;margin-left: 10px;">取消
        </button>
        <button class="btn btn-outline-success" ng-click="saveApi()"
                style="float:right; height: 30px;font-size: 12px;margin-left: 10px;">{{gatewayApiDialog.confirmBtnText}}
        </button>
        <button class="btn btn-default" ng-click="saveApiAndContinue()"
                ng-if="gatewayApiDialog.saveAndContinueBtnText"
                style="float:right; height: 30px;font-size: 12px;">{{gatewayApiDialog.saveAndContinueBtnText}}
        </button>
      </div>
    </div>
  </div>
</div>
